package com.cold.demo.template.filter;

import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.util.Date;

/*
    drop table if exists request_log;
    CREATE TABLE request_log
    (
        id                   int NOT NULL AUTO_INCREMENT COMMENT '主键id',
        is_deleted           int NOT NULL  DEFAULT 0 COMMENT '是否已删除,1已删除0未删除',
        create_time          datetime      default current_timestamp COMMENT '创建时间',
        update_time          datetime      default current_timestamp COMMENT '更新时间',
        method               varchar(16)   default null comment '请求方式',
        content_type         varchar(16)   default null comment '请求类型',
        cookies              varchar(1024) default null comment 'cookies',
        remote_addr          varchar(32)   default null comment '远程主机地址',
        remote_host          varchar(32)   default null comment '远程主机host',
        remote_port          int           default null comment '远程主机端口',
        request_start_time   bigint        default null comment '请求开始时间',
        request_end_time     bigint        default null comment '请求结束时间',
        request_consume_time int           default null comment '耗时 ms',
        request_url          varchar(256)  default null comment '请求url',
        request_headers      varchar(1024) default null comment '请求头',
        request_body         varchar(1024) default null comment '请求体',
        request_params       varchar(1024) default null comment '请求参数',
        response_headers     varchar(1024) default null comment '响应头',
        response_status      int           default null comment '响应状态码',
        response_body        varchar(1024) default null comment '响应体',
        redirect_url        varchar(256)   default null comment '重定向地址',
        PRIMARY KEY (id) USING BTREE
    ) ENGINE = MyISAM
      DEFAULT CHARSET = utf8mb4
      COLLATE = utf8mb4_general_ci
      ROW_FORMAT = DYNAMIC COMMENT ='请求记录';
 */
@Getter
@Setter
public final class RequestLog implements Serializable {
    private Long    id;
    private String  method;
    private String  content_type;
    private String  cookies;
    private String  remote_addr;
    private String  remote_host;
    private Integer remote_port;
    private Date    request_start_time;
    private Date    request_end_time;
    private Long    request_consume_time;

    private String request_url;
    private String request_headers;
    private String request_body;
    private String request_params;

    private String  response_headers;
    private Integer response_status;
    private String  response_body;

    private String redirect_url;

}
